Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add SDS protocol for scalable e2e reliability #108

Merged
merged 5 commits into from
Nov 28, 2024

Conversation

jm-clius
Copy link
Contributor

Introduces the "Scalable Data Sync" protocol, based on the e2e reliability mechanisms discussed in the Vac forum post.

The initial aim is to provide an end-to-end reliability protocol for Status chat protocols, specifically within the context of Status Communities.

vac/raw/sds.md Outdated Show resolved Hide resolved
```protobuf
syntax = "proto3";

message Message {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may actually make sense to have a LogEntry or Entry terminology in this spec because the term message is very generic, and actually already a bit confusing in the status-go codebase.

Or maybe doing like WakuMessage and prefix/postfix to help with setting the context.

Copy link
Contributor Author

@jm-clius jm-clius Nov 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good point, although I'm struggling to find a term that wouldn't create confusion elsewhere. "Log" and "log entries" are already overloaded terms too and the mental model of "messages = log entries" may not be immediately apparent to someone approaching the code. Perhaps just calling it a SyncedMessage? Wdyt?

vac/raw/sds.md Outdated Show resolved Hide resolved

message Message {
//1 Reserved for sender/participant id
string message_id = 2; // Unique identifier of the message
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concretely, is that a Waku message id or a Status envelop id?

I assume Waku message id because one needs to be able to retrieve it from a store node?

But then if you cannot find the message from a Waku store, you can't have a re-transmission of it because it would change the hash of the message (timestamp is included).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be a Status-level ID as the Waku message ID would (well, should) be inaccessible at this layer. A mapping could be done from SDS message ID to Waku message hash that gets updated with each retransmission.

vac/raw/sds.md Outdated Show resolved Hide resolved
If dependencies are unmet,
the participant MUST add the message to the incoming buffer of messages with unmet causal dependencies.

#### Deliver Message
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could it be Record message instead? I understand this step is about inscribing the message to the local log to handover to the application. or Transcribe.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case we chose "deliver" as it matches terminology in related literature (specifically here: https://arxiv.org/pdf/2012.00472)

vac/raw/sds.md Show resolved Hide resolved
vac/raw/sds.md Outdated

#### Periodic Incoming Buffer Sweep

The participant MUST periodically check causal dependencies for each message in the incoming buffer.- For each message in the incoming buffer:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The participant MUST periodically check causal dependencies for each message in the incoming buffer.- For each message in the incoming buffer:
The participant MUST periodically check causal dependencies for each message in the incoming buffer. For each message in the incoming buffer:

vac/raw/sds.md Outdated Show resolved Hide resolved

#### Periodic Outgoing Buffer Sweep

The participant MUST rebroadcast **unacknowledged** outgoing messages after a set period.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Waku message hash changes when re-broadcast. How is this handled?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of scope of this spec, as it focuses on the SDS protocol in isolation.
In practice, the various Waku "transport level" hashes should be mapped to the SDS-level message ID. When a message gets rebroadcast, the Waku hash may be updated for the same message ID entry.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SDS-level message ID what is it in practical term in Status context?

Copy link
Collaborator

@jimstir jimstir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a couple suggestions, but LGTM regardless. Also do not worry about markdown lint, the line-length requirement has been removed.

vac/raw/sds.md Show resolved Hide resolved
vac/raw/sds.md Outdated Show resolved Hide resolved
@jm-clius jm-clius merged commit bee78c4 into main Nov 28, 2024
0 of 2 checks passed
@jm-clius jm-clius deleted the docs/add-sds-protocol branch November 28, 2024 16:22
@pajicf pajicf removed their request for review November 28, 2024 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants